local XLoot = select(2, ...)

local function CompileLocales(locales)
	local L = locales[GetLocale()] and locales[GetLocale()] or locales.enUS
	if L ~= locales.enUS then
		setmetatable(L, { __index = locales.enUS })
		for k, v in pairs(L) do	
			if type(v) == 'table' then
				setmetatable(v, { __index = locales.enUS[k] })
			end
		end
	end
	return L
end

-- locales expects table: { enUS = {...}, ... }
function XLoot:Localize(name, locales)
	self["L_"..name] = CompileLocales(locales)
end

local locales = {
	enUS = {
		skin_svelte = "XLoot: Svelte",
		skin_legacy = "XLoot: Legacy",
		skin_smooth = "XLoot: Smooth",
	},
	-- Possibly localized
	ptBR = {},
	frFR = {},
	deDE = {},
	koKR = {},
	esMX = {},
	ruRU = {},
	zhCN = {},
	esES = {},
	zhTW = {},
}

-- Automatically inserted translations
-- See: http://wow.curseforge.com/addons/xloot-1-0/localization/ to create or fix translations



locales.koKR["Options/confirm_reset_profile"] = "이 프로필에 대한 모든 옵션을 초기화 합니다. 계속 하시겠습니까?" -- Needs review
locales.koKR["Options/profile"] = "프로필" -- Needs review
locales.koKR["Options/when_always"] = "항상" -- Needs review
locales.koKR["Options/when_auto"] = "자동" -- Needs review


locales.ruRU["Options/confirm_reset_profile"] = "Это сбросит все параметры этого профиля. Вы уверены?" -- Needs review
locales.ruRU["Options/profile"] = "Профиль" -- Needs review
locales.ruRU["Options/when_always"] = "Всегда" -- Needs review
locales.ruRU["Options/when_auto"] = "Авто" -- Needs review
locales.ruRU["Options/when_never"] = "Никогда" -- Needs review
locales.ruRU["Options/when_solo"] = "Соло" -- Needs review

locales.zhCN["Options/confirm_reset_profile"] = "这将重置此配置文件的全部选项。确定？"
locales.zhCN["Options/profile"] = "配置文件"
locales.zhCN["Options/when_always"] = "总是"
locales.zhCN["Options/when_auto"] = "自动"
locales.zhCN["Options/when_never"] = "从不"
locales.zhCN["Options/when_solo"] = "单人"

locales.esES["Options/confirm_reset_profile"] = "Esto reseteará todas las opciones de este perfil. ¿Estás seguro?" -- Needs review
locales.esES["Options/profile"] = "Perfil" -- Needs review
locales.esES["Options/when_always"] = "Siempre" -- Needs review
locales.esES["Options/when_auto"] = "Automático" -- Needs review
locales.esES["Options/when_never"] = "Nunca" -- Needs review
locales.esES["Options/when_solo"] = "Solo" -- Needs review

locales.zhTW["Options/confirm_reset_profile"] = "將會重置此設定檔的所有設定。你確定要重置嗎？"
locales.zhTW["Options/profile"] = "設定檔"
locales.zhTW["Options/when_always"] = "總是"
locales.zhTW["Options/when_auto"] = "自動"
locales.zhTW["Options/when_never"] = "從不"
locales.zhTW["Options/when_solo"] = "單人"



XLoot.L = CompileLocales(locales)
